(route #0 bug) enforce sequential route numbers when writing route output.
authoralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 6 Aug 2003 14:13:17 +0000 (14:13 +0000)
committeralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 6 Aug 2003 14:13:17 +0000 (14:13 +0000)
gpsbabel/magproto.c
gpsbabel/reference/route/magellan.rte

index 0d191a99f34a21b7777858914608cd0b5032d4ec..888c47ff071056b89c0872f0a848f7ee808bedf0 100644 (file)
@@ -43,7 +43,7 @@ static void *mkshort_handle;
 static char *deficon;
 static char *bs;
 static char *noack;
-
+static int route_out_count;
 
 typedef enum {
        mrs_handoff = 0,
@@ -1274,6 +1274,9 @@ mag_route_trl(const route_head * rte)
        /* number of output PMGNRTE messages at 2 points per line */
        numlines = (i / 2) + (i % 2);
        
+       /* increment the route counter. */
+       route_out_count++;
+       
        thisline = i = 0;
        QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
                waypointp = (waypoint *) elem;
@@ -1295,7 +1298,7 @@ mag_route_trl(const route_head * rte)
                        thisline++;
 
                        sprintf(obuff, "PMGNRTE,%d,%d,c,%d,%s,%s", 
-                               numlines, thisline, rte->rte_num,
+                               numlines, thisline, route_out_count,
                                buff1, buff2);
 
                        mag_writemsg(obuff);
@@ -1314,6 +1317,7 @@ mag_route_hdr(const route_head *rh)
 static void
 mag_route_pr()
 {
+       route_out_count = 0;
        route_disp_all(mag_route_hdr, mag_route_trl, mag_waypt_pr);
 
 }
index d7b9b55d146d4a8eba1ef1427f5274d2b0d32d46..6ded2831b0941ce53c70c090e5f53f9441aa83f5 100644 (file)
@@ -9,14 +9,14 @@ $PMGNWPL,2424.000,N,08824.000,W,0000000,M,43A,,a*06
 $PMGNWPL,2336.000,N,08712.000,W,0000000,M,42A,,a*09\r
 $PMGNWPL,2300.000,N,08536.000,W,0000000,M,41A,,a*0B\r
 $PMGNWPL,2218.000,N,08424.000,W,0000000,M,40A,,a*00\r
-$PMGNRTE,6,1,c,0,49B,a,49A,a*00\r
-$PMGNRTE,6,2,c,0,48B,a,48A,a*03\r
-$PMGNRTE,6,3,c,0,47B,a,47A,a*02\r
-$PMGNRTE,6,4,c,0,46A,a,43A,a*03\r
-$PMGNRTE,6,5,c,0,42A,a,41A,a*04\r
-$PMGNRTE,6,6,c,0,40A,a,*0C\r
+$PMGNRTE,6,1,c,1,49B,a,49A,a*01\r
+$PMGNRTE,6,2,c,1,48B,a,48A,a*02\r
+$PMGNRTE,6,3,c,1,47B,a,47A,a*03\r
+$PMGNRTE,6,4,c,1,46A,a,43A,a*02\r
+$PMGNRTE,6,5,c,1,42A,a,41A,a*05\r
+$PMGNRTE,6,6,c,1,40A,a,*0D\r
 $PMGNWPL,3016.831,N,09141.153,W,0000000,M,ATLAUN,Launch at Butte LaRose,i*15\r
 $PMGNWPL,3017.463,N,09137.630,W,0000000,M,ATWRNC,Canal to Warner Lake,k*38\r
 $PMGNWPL,3018.883,N,09138.767,W,0000000,M,ATWRNR,Warner Lake,a*78\r
-$PMGNRTE,2,1,c,1,ATLAUN,i,ATWRNC,k*1A\r
-$PMGNRTE,2,2,c,1,ATWRNR,a,*44\r
+$PMGNRTE,2,1,c,2,ATLAUN,i,ATWRNC,k*19\r
+$PMGNRTE,2,2,c,2,ATWRNR,a,*47\r